package com.heima.admin.controller.v1;
/*
    
 需求描述：
 @Author: wang
 @Date: 2022/10/21 17:38
 
 */

import com.heima.admin.service.SensitiveWordService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmSensitiveDto;
import com.heima.model.wemedia.dtos.WmSensitivePageReqDto;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveWordController {

    @Autowired
    private SensitiveWordService sensitiveWordService;

    @PostMapping("/save")
    public ResponseResult saveSensitive(@RequestBody WmSensitiveDto dto){
        return sensitiveWordService.saveSensitive(dto);
    }

    @PostMapping("/list")
    public ResponseResult listSensitive(@RequestBody WmSensitivePageReqDto dto){
        return sensitiveWordService.listSensitive(dto);
    }

    @PostMapping("/update")
    public ResponseResult updateSensitive(@RequestBody WmSensitiveDto dto ){
        return sensitiveWordService.updateSensitive(dto);
    }

    @DeleteMapping("/del/{id}")
    public ResponseResult deleteSensitive(@PathVariable Integer id){
        return sensitiveWordService.deleteSensitive(id);
    }
}
